﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;

namespace SmartMathLibrary.Space
{
    /// <summary>
    /// This class represents a log entry to log a thread ID and the number of accesses.
    /// </summary>
    [Serializable]
    public class LogEntry
    {
        /// <summary>
        /// This field holds the thread ID.
        /// </summary>
        private int threadID;

        /// <summary>
        /// This field holds a counter variable.
        /// </summary>
        private int counter;

        /// <summary>
        /// Initializes a new instance of the <see cref="LogEntry"/> class.
        /// </summary>
        /// <param name="threadID">The thread ID.</param>
        public LogEntry(int threadID)
        {
            this.threadID = threadID;
            this.counter = 0;
        }

        /// <summary>
        /// Gets or sets the thread ID.
        /// </summary>
        /// <value>The thread ID.</value>
        public int ThreadID
        {
            get { return this.threadID; }
            set { this.threadID = value; }
        }

        /// <summary>
        /// Gets the counter variable.
        /// </summary>
        /// <value>The counter variable.</value>
        public long Counter
        {
            get { return this.counter; }
        }

        /// <summary>
        /// Increments the counter.
        /// </summary>
        public void IncrementCounter()
        {
            this.counter++;
        }
    }
}